const fs = require('fs')
const {
    getUrlAndNameMore
} = require('./getUrlAndNameMore')
const {
    getUrlAndNameSingle
} = require('./getUrlAndNameSingle')

module.exports.getAllMusicInfo = function () {

}

console.time('start')
fs.readFile(__dirname + '\\..\\Data\\singerInfo.json', (err, data) => {
    if (err) {
        console.log('读取歌手列表信息失败')
    } else { // 
        let singerInfo = JSON.parse(data),
            len = singerInfo.length
        for (let i = 1300; i < len; i++) {
            if (singerInfo[i].hasPage) {
                getUrlAndNameMore(singerInfo[i].url, singerInfo[i].singer, singerInfo[i].id)
            } else {
                getUrlAndNameSingle(singerInfo[i].url, singerInfo[i].singer, singerInfo[i].id)
            }
        }
        console.log(singerInfo.length)
        console.timeEnd('start')
    }
})